#from garth.sso import login

import garth

garth.configure(domain="garmin.cn")

email = "292886995@qq.com"
password = "Qingtian.1996"
# If there's MFA, you'll be prompted during the login
oauth1, oauth2=garth.login(email, password)

#print(oauth1)
#print(oauth2)

sleep = garth.connectapi(
    f"/wellness-service/wellness/dailySleepData/{garth.client.username}",
    params={"date": "2025-06-12", "nonSleepBufferMinutes": 60},
)

if sleep is not None:
    list(sleep.keys())
else:
    print("No sleep data available.")
